package me.keiwu.admin.service;

import me.keiwu.admin.domain.system.SysInviteCode;
import me.keiwu.admin.domain.system.SysRole;
import me.keiwu.admin.domain.system.SysUser;
import org.springframework.security.core.userdetails.UserDetailsService;

import javax.validation.constraints.NotNull;
import java.util.List;
import java.util.Set;

/**
 * Created by kei on 31/10/2017.
 */
public interface UserService extends UserDetailsService {

    SysUser login(String username, String password);

    SysInviteCode verifyInviteCode(String code);

    void addInviteCodes(List<String> codes, int sysRoles);

    SysUser register(@NotNull String username, @NotNull String password, @NotNull Integer type,
                     String firstName, String lastName, String email, String imageUrl);

    boolean changeProfile(SysUser user, String firstName, String lastName, String email, String imageUrl);

    boolean changePassword(SysUser user, @NotNull String password);

    boolean changeRoles(SysUser user, @NotNull Set<SysRole> roleSet);

}
